﻿<Window x:Class="DTC.Popups.VisitPopup"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Converters="clr-namespace:DTC.Converters"
		xmlns:Validations="clr-namespace:DTC.Validations"
        Title="Прием врача" Height="500" Width="420" Style="{StaticResource PopupWindow}"
        Closing="Window_Closing"
        Loaded="Window_Loaded">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/TextEditStyles.xaml"/>
                <ResourceDictionary Source="../Resources/Brushes.xaml"/>
                <ResourceDictionary Source="../Resources/ComboBoxesStyles.xaml "/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid Name="MainGrid" Margin="20" VerticalAlignment="Center">
        <Grid.RowDefinitions>
            <RowDefinition Height="64"/>
            <RowDefinition Height="32"/>
            <RowDefinition Height="32"/>
            <RowDefinition Height="32"/>
            <RowDefinition Height="32"/>
            <RowDefinition Height="36"/>
            <RowDefinition Height="100"/>
        </Grid.RowDefinitions>
        <Grid Grid.RowSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.5*"/>
                <ColumnDefinition Width="0.5*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="32"/>
                <RowDefinition Height="32"/>
            </Grid.RowDefinitions>
            <TextBlock Text="Начало приема:"
                       VerticalAlignment="Center"
                       Margin="0,20,0,0"/>
            <TextBlock Text="Окончание приема:"
                       VerticalAlignment="Center"
                       Grid.Column="1"
                       Margin="0,20,0,0"/>
            <TextBox Name="TimeFrom"
                     Grid.Column="0" Grid.Row="1"
                     Margin="5,0,15,0"
                     VerticalAlignment="Center">
                <Binding Path="DateFrom" NotifyOnValidationError="True">
                    <Binding.Converter>
                        <Converters:DateTimeToTimeConverter></Converters:DateTimeToTimeConverter>
                    </Binding.Converter>
                     	<Binding.ValidationRules>
                        	<Validations:EmptyValidate/>
                        </Binding.ValidationRules>
					</Binding>
            </TextBox>
            <TextBox Name="TimeTo"
                     Grid.Column="1" Grid.Row="1"
                     Margin="15,0,5,0"
                     VerticalAlignment="Center">
                <Binding Path="DateTo" NotifyOnValidationError="True">
                    <Binding.Converter>
                        <Converters:DateTimeToTimeConverter></Converters:DateTimeToTimeConverter>
                    </Binding.Converter>
                     	<Binding.ValidationRules>
                        	<Validations:EmptyValidate/>
                        </Binding.ValidationRules>
					</Binding>
            </TextBox>
        </Grid>
        <TextBlock Text="Принимающий врач"
                   Grid.Row="1"
                   VerticalAlignment="Center"
                   Margin="0,20,0,0"/>
        <ComboBox Name="DoctorsListBox"
                  DisplayMemberPath="FullName"
                  IsEditable="True"
                  Grid.Row="2" 
                  Height="30" Width="280"
                  Margin="5,0,5,0"/>
        <TextBlock Text="Пациент"
                   Grid.Row="3"
                   Margin="0,20,0,0"
                   VerticalAlignment="Center"/>
        <ComboBox Name="PatientsListBox"
                  DisplayMemberPath="FullName"
                  IsEditable="True"
                  Grid.Row="4" 
                  Height="32" Width="280"
                  Margin="5,0,5,0" IsTextSearchEnabled="True" />
        <TextBlock Text="Описание"
                   Grid.Row="5" 
                   Margin="0,20,0,0" />
        <TextBox Name="Description"
                 Text="{Binding Description}"
                 BorderThickness="1"
                 Grid.Row="6" 
                 Height="80"
                 AcceptsReturn="True"
                 VerticalAlignment="Center" 
                 VerticalContentAlignment="Top"
                 TextWrapping="Wrap" />
    </Grid>
</Window>
